-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to disable fnc_globalExecute #270
Conversation
Mission makers and/or server managers can disable the use of CBA_fnc_globalExecute either by using a mission setting or an optional addon. When disabled, calling fnc_globalExecute does nothing. Fixes #269
@@ -95,8 +93,38 @@ if (SLX_XEH_MACHINE select 3) then { | |||
}; | |||
}; | |||
|
|||
// CBA_fnc_globalExecute is normally enabled | |||
_disableGE = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
👍 for the optional pbo |
|
||
[QUOTE(GVAR(cmd)), { if (GVAR(init)) then { _this spawn FUNC(exec) } }] call (uiNamespace getVariable "CBA_fnc_addEventHandler"); | ||
if (_disableGE) then { | ||
uiNamespace setVariable [QGVAR(exec), compileFinal ""]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be QUOTE(DFUNC(exec))
?
I don't think we want to use uiNameSpace / caching for this function at all.
Otherwise I can create a mission with it disabled, and it will compileFinal the function to {}
in UI
then join a server with it enabled and PREP will still pull the {}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - the idea was to make sure "FUNC(exec)" cannot be used nor restored (by non-CBA means) while globalExecute is disabled.
looks good 👍 |
Add the ability to disable fnc_globalExecute
Good. Let's update the optionals section of README.md |
This needs more work to handle a few more...issues. (Discussed elsewhere) |
Mission makers and/or server managers can disable the use of
CBA_fnc_globalExecute either by using a mission setting or
an optional addon. When disabled, calling fnc_globalExecute
does nothing. Fixes #269